﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LinqToDbmlRunner;
using schemas.microsoft.com.linqtosql.dbml.Item2007;

namespace DbmlProject
{
	class DbmlScript : LinqToDbmlScript
	{
		public override void Apply(XRoot root)
		{
			foreach (var table in root.Database.Table.Where(t => t.Member.StartsWith("An_")))
			{
				table.Member = table.Member.Substring(3);
				table.Type.Name = table.Type.Name.Substring(3);
			}
			root.ExtrapolateSubclasses();
		}
	}
}
